package com.example.springcloud.entity;

import lombok.Data;

import java.io.Serializable;

/**
 * The type Payment.
 */
@Data
public class Payment implements Serializable {

    private static final long serialVersionUID = 1L;

    private Integer id;

    private String serial;

    @Override
    public boolean equals(Object that) {

        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Payment other = (Payment) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
                && (this.getSerial() == null ? other.getSerial() == null : this.getSerial().equals(other.getSerial()));
    }

    @Override
    public int hashCode() {

        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getSerial() == null) ? 0 : getSerial().hashCode());
        return result;
    }

    @Override
    public String toString() {

        return getClass().getSimpleName() +
                " [" +
                "Hash = " + hashCode() +
                ", id=" + id +
                ", serial=" + serial +
                ", serialVersionUID=" + serialVersionUID +
                "]";
    }

}